package com.yan.domain;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author taoge
 * @Date 2024/8/22 19:10
 * @Description
 */
public class Student implements Serializable {
    @Serial
    private static final long serialVersionUID = 6388468461468452767L;
    private Integer id;
    private String name;
    private Integer age;
    private Double weight;
    private String address;
    private Integer classID;

    public Student(Integer id, String name, Integer age, Double weight, String address, Integer classID) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.weight = weight;
        this.address = address;
        this.classID = classID;
    }

    public Student() {

    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Double getWeight() {
        return weight;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getClassID() {
        return classID;
    }

    public void setClassID(Integer classID) {
        this.classID = classID;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student student = (Student) o;

        if (id != null ? !id.equals(student.id) : student.id != null) return false;
        if (name != null ? !name.equals(student.name) : student.name != null) return false;
        if (age != null ? !age.equals(student.age) : student.age != null) return false;
        if (weight != null ? !weight.equals(student.weight) : student.weight != null) return false;
        if (address != null ? !address.equals(student.address) : student.address != null) return false;
        return classID != null ? classID.equals(student.classID) : student.classID == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (age != null ? age.hashCode() : 0);
        result = 31 * result + (weight != null ? weight.hashCode() : 0);
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (classID != null ? classID.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", weight=" + weight +
                ", address='" + address + '\'' +
                ", classID=" + classID +
                '}';
    }
}
